package org.zxl.springbootdemo.hsqldb.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

@Component
public class DemoDao2 {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public int demoCount(){
        String sql = "select count(*) from demo";
        return jdbcTemplate.queryForObject(sql, Integer.class);
    }
}
